<template>
  <div class="employee">
    <lRTitle :text="statusTitle"></lRTitle>
    <div class="main">
      <div class="container">
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/aqsj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">安全事件</span>
            <span class="text-bottom">{{chartData.EventLog || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/rjgj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">软件管家</span>
            <span class="text-bottom">{{chartData.Software || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/mdwj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">病毒文件</span>
            <span class="text-bottom">{{chartData.FileVirusCheck || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/azrj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">安装软件</span>
            <span class="text-bottom">{{chartData.InstallApp || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/rjwl@2x.png">
          </div>
          <div class="text">
            <span class="text-top">软件外联</span>
            <span class="text-bottom">{{chartData.sum_sysmon_connect_log || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/aqsj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">共享目录</span>
            <span class="text-bottom">{{chartData.ShareDir || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/kfdk@2x.png">
          </div>
          <div class="text">
            <span class="text-top">开放端口</span>
            <span class="text-bottom">{{chartData.OpenPorts || 0 }}</span>
          </div>
        </div>
        <div class="block">
          <div class="circle">
            <img src="@/assets/aiScreen/zqrj@2x.png">
          </div>
          <div class="text">
            <span class="text-top">自启软件</span>
            <span class="text-bottom">{{chartData.AutoStartup || 0 }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
  
<script>
import lRTitle from './lRTitle.vue';

export default {
  name: "employeeRank",
  props: {
    chartData: {
      type: Object,
      default: () => [],
      required: true // 确保 data 被传递
    }
  },
  data() {
    return {
      statusTitle: "核心数据",
    };
  },
  components: {
    lRTitle
  },
  methods: {

  }
};
</script>
  
<style lang="scss" scoped>
.employee {
  position: relative;
  height: 56%;
  /* 使用视口高度单位，或根据需要调整 */
}

.main {
  height: calc(100% - 50px);
  display: flex;
  align-items: center;
  justify-content: center;

  .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5vw;
    /* 水平和垂直间隔均为 30px */
    width: 460px;
    /* 2 × 200px 块 + 30px 间隔 + 边距 */
    margin: 0 auto;

    /* 居中 */
    .block {
      width: 38%;
      height: 7vh;
      padding: 10px;
      background-color: #0e283d;
      border: 1px solid #1f394e;
      color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      .circle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 60px;
        /* 示例颜色，可替换为图片 */
        margin-right: 10px;
        /* 圆形与文字间隔 */
        flex-shrink: 0;
        /* 防止圆形被压缩 */
        img {
          width: 90%;
        }
      }

      .text {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
        /* 占据剩余空间 */
      }

      .text-top {
        font-size: 14px;
        color: #9ba1a8;
        /* 上行文字颜色 */
        line-height: 1.4;
        /* 行高调整间距 */
      }

      .text-bottom {
        font-size: 18px;
        color: #FEFEFE;
        font-weight: 600;
        /* 下行文字颜色 */
        line-height: 1.4;
      }
    }
  }
}</style>